package com.example.controller;

import com.example.entity.EasybuyNews;
import com.example.service.EasybuyNewsService;
import com.example.util.RespBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class EasybuyNewsController {

    @Autowired
    public EasybuyNewsService easybuyNewsService;

    @RequestMapping(value = "news")
    public RespBean findAllneas(){
        List<EasybuyNews> allnews = easybuyNewsService.findAllnews();
        return RespBean.ok("查询成功",allnews);
    }

}
